import 'package:json_annotation/json_annotation.dart';

part 'store_categories.g.dart';

@JsonSerializable()
class StoreCategories {
  final List<Category> childCategoriesV2;

  StoreCategories(this.childCategoriesV2);

  factory StoreCategories.fromJson(Map<String, dynamic> json) => _$StoreCategoriesFromJson(json);

  Map<String, dynamic> toJson() => _$StoreCategoriesToJson(this);
}

@JsonSerializable()
class Category {
  final int id;
  final String name;
  final String imageUrl;
  final List<Category> children;

  Category(this.id, this.name, this.imageUrl, this.children);

  factory Category.fromJson(Map<String, dynamic> json) => _$CategoryFromJson(json);

  Map<String, dynamic> toJson() => _$CategoryToJson(this);
}
